﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AttributeRouting.Web.Mvc;
using MvcToolbox.WebTest.Models;

namespace MvcToolbox.WebTest.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";
            var model = new MvcToolbox.WebTest.Models.Users(0);
            return View(model);
        }

        [HttpGet]
        public ActionResult About()
        {
            AboutModel model = new AboutModel();
            model.Items.Add(new ItemModel() { Name = "Test", GroupName = "group", IsChecked = false });
            model.Items.Add(new ItemModel() { Name = "Test1", GroupName = "group", IsChecked = false });
            model.Items.Add(new ItemModel() { Name = "Test2", GroupName = "group", IsChecked = true });
            model.Items.Add(new ItemModel() { Name = "Test3", GroupName = "group", IsChecked = false });
            return View(model);
        }

        [HttpPost]
        public ActionResult About(AboutModel model)
        {
            return View(model);

        }
    }
}
